package com.niuwa.p2p.action.customer;
import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;

import com.niuwa.p2p.action.JsonAction;
import com.niuwa.p2p.core.mvc.entity.PageBean;
import com.niuwa.p2p.entity.fund.AccountFlow;
import com.niuwa.p2p.service.fund.IAccountFlowManagerService;

/**
 * 
 * @ClassName: UserAction
 * @Descriptio 用户Action
 * @author:    jishengjun
 * 
 */

public class AccountFundRecordAction extends JsonAction{

	private static final long serialVersionUID = -8900124777631535966L;

	/** 日志 */
	private static Logger logger = Logger.getLogger(AccountFundRecordAction.class);
	
	private String customerId;


	@Autowired
	private  IAccountFlowManagerService   accountFlowManagerService;

/**************************************************************************客户资金账户记录开始**********************************************************************************************************************/

	

	/**
	 *查询客户资金账户记录
	 * @return
	 * @throws Exception
	 */

	@Action(value="searchBankrollRecord")
	public String searchBankrollRecord() throws Exception {
		setObjectReSult(queryBankrollRecord());
		logger.info("searchBankrollRecord action execute success");
		return NONE;
	}
	
	
	/**
	 * 分页查询客户资金账户列表
	 * 
	 * @return Pagination<AccountFlow> 
	 */
	private PageBean<AccountFlow> queryBankrollRecord() {

		// 获取查询参数
		Map<String, Object> paramMap = getParamMap();
		
		paramMap.put("acctKind", "CUST");

		// 查选分页集合
		PageBean<AccountFlow> page =  accountFlowManagerService.searchBankrollRecord(paramMap);
		
		return page;
	}
	
	
	/*************************************************************************客户资金账户记录结束**********************************************************************************************************************/
	

	public String getCustomerId() {
		return customerId;
	}


	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	
	
	public IAccountFlowManagerService getAccountFlowManagerService() {
		return accountFlowManagerService;
	}

	public void setAccountFlowManagerService(
			IAccountFlowManagerService accountFlowManagerService) {
		this.accountFlowManagerService = accountFlowManagerService;
	}
}
